Jump to content

set cookie.path to "server relative" value. need just one cookie for whole site!


micah1701

Recommended Posts

I'm using mod rewrite to make friendly URLs on my site.
so the url

/information/blah

is really running a file in the root folder like: 

index.php?information=blah 

My problem is that I'm using a javascript cookie but every time someone clicks a link and the URL changes, it creates a new cookie instead of updating the current cookie.

What is the work around for this?
when other problems came up from using the mod rewrite, I found I could just use the "server relative" value of all of my links within the site (ie just ad a "/" before the path) and that fixed the problem.  But I'm having some trouble doing that in javascript for this cookie.

I tried:  document.cookie.path = "/";

didn't help.  Other thoughts?  Thanks!!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.