Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

HELP on setting cookie as per screen resolution.

How can I set a cookie with user's screen resolution to low?



9:58 pm on Sep 27, 2011 (gmt 0)

Hello all,

Wondering if someone can help me with this. I would like to set/create a single-use/temporary "cookie" for the duration of the user's session or possibly for up to 2 days and have a popup alert box, telling them that their screen resolution is too low to view.

I have searched far and wide to see how it could be done, but I was not successful. I spent the better part of 2 hours on the Internet today, can you help me?

Thank you. Here is my existing Javascript below. Could someone implement and/or rewrite it with the cookie? I would appreciate it very much.

<script type="text/javascript">


if (screen.height<768 || screen.width<1024) alert ("Your screen's resolution is below 1024x768.\nThis site works better at higher resolutions.");

// -->



12:29 am on Sep 28, 2011 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Gosh, this question sounds familiar. Anyone up for a fistfight?



2:13 pm on Sep 28, 2011 (gmt 0)

Oohhh please, no need to fight over 'lil 'ol me, hahaha!


5:31 pm on Sep 28, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Well, that link will give you an answer - but long story short, dictating to the user what environment they need to have to view your site tells you one thing, and one thing only: you're doing something wrong. :-)

Featured Threads

Hot Threads This Week

Hot Threads This Month