Brief sysnopsis dear Monks...

I'm wirting something far larger than I had imagined but... Admin system where multiple users can administer their own pages (so I don't have to) thru admin GUI.

Have read as much as possible about Cookies and am using CGI::Cookie.

Thought I had the hang of it until I created a "Preview" link for admin users. Window opens no probs (who can screw-up on a simple one-liner of javascript?!?) but the cookies appear to be reset. Upon closing the new window and clicking on another link within the admin system, the User is bugged-out 'cos there are no cookie values!

I'm positive this is considered a "session" issue but can't quite get the hang of it... yet.

As an example, I first noticed the prob when I created a link which opens a new window and displays a photo (or any photo) previously uploaded by the user. The upload program is a seperate file (chmod 777 etc...= with a "Location:http://www.my.com etc" upon successful upload. In this file, there are no $query=>cookie variables, no cookies are checked for their existence, neiher are any cookies set. This works as it should - presumably because it doesn't open a new window(?).

Yet upon opening a new window to get a preview of any photo (or text or whatever) uploaded, something somewhere happens and I get sent to the login page when I click on another link after closing the new window. Hense I'm presuming it to be a session issue. Right or wrong? You tell me.

I'm hoping that, with a gentle nudge in the right direction (although full-blown code would be greatly appreciated), I'll be able to squish this problem and maintain session status across numerous windows - I'm planning on having several "preview" windows for both text and photos and don't really want the user to be spat-out of the admin system every time they want to check on something purely because I haven't got the cookie issue right!

Any help/advice is... you know what - and Yes! I have done searches etc...

Kind regards in advance (also big thanks to those who reply)

Richard
Principality of Andorra (yes - it does exist!)


In reply to Cookie & Session type problem... by meetn2veg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.