How to store session ID without cookies and without "Cookieless=True"

Discussion in 'ASP .Net' started by Paul W, May 28, 2005.

  1. Paul W

    Paul W Guest

    Hi -

    I don't want to rely on my users having cookies enabled.

    If I use Cookieless=True it of course mangles the urls which means there is
    no browser caching of the pages, so it is slow.

    What are the other options to use to be able to store a small amount of
    session data? I know it can be done because, for example,
    www.discountasp.net's site doesn't use cookies or cookie-munging, but it
    works just fine to remember my login throughout the site.

    Thanks for all input,

    Paul.
     
    Paul W, May 28, 2005
    #1
    1. Advertising

  2. Paul W

    Brock Allen Guest

    > What are the other options to use to be able to store a small amount
    > of session data? I know it can be done because, for example,
    > www.discountasp.net's site doesn't use cookies or cookie-munging, but
    > it works just fine to remember my login throughout the site.


    What makes you think it's not using cookies? I just ran a test with and without
    cookies and I must enable cookies for their site to login.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, May 28, 2005
    #2
    1. Advertising

  3. Paul W

    gaidar Guest

    You have three ways:
    1. Store session ID in cookie file
    2. Store Session ID in the URL (for example,
    mysite.com/HFFKSJ3F35R4W46HR435YFS/myFolder/myPage.aspx
    3. Store Session ID in QueryString (for example,
    mysite.com/myFolder/myPage.aspx?SID=HFFKSJ3F35R4W46HR435YFS

    Nothing more. You should select :)

    Gaidar

    "Paul W" <> wrote in message
    news:%...
    > Hi -
    >
    > I don't want to rely on my users having cookies enabled.
    >
    > If I use Cookieless=True it of course mangles the urls which means there
    > is no browser caching of the pages, so it is slow.
    >
    > What are the other options to use to be able to store a small amount of
    > session data? I know it can be done because, for example,
    > www.discountasp.net's site doesn't use cookies or cookie-munging, but it
    > works just fine to remember my login throughout the site.
    >
    > Thanks for all input,
    >
    > Paul.
    >
     
    gaidar, May 28, 2005
    #3
  4. Paul W

    Chiky Guest

    But how to implement storing sessionid in QueryString? IF I have a
    sessionID passed through QueryString, i can't initialize session with
    this ID.

    Chiky

    gaidar wrote:
    > You have three ways:
    > 1. Store session ID in cookie file
    > 2. Store Session ID in the URL (for example,
    > mysite.com/HFFKSJ3F35R4W46HR435YFS/myFolder/myPage.aspx
    > 3. Store Session ID in QueryString (for example,
    > mysite.com/myFolder/myPage.aspx?SID=HFFKSJ3F35R4W46HR435YFS
    >
    > Nothing more. You should select :)
    >
    > Gaidar
    >
    > "Paul W" <> wrote in message
    > news:%...
    >
    >>Hi -
    >>
    >>I don't want to rely on my users having cookies enabled.
    >>
    >>If I use Cookieless=True it of course mangles the urls which means there
    >>is no browser caching of the pages, so it is slow.
    >>
    >>What are the other options to use to be able to store a small amount of
    >>session data? I know it can be done because, for example,
    >>www.discountasp.net's site doesn't use cookies or cookie-munging, but it
    >>works just fine to remember my login throughout the site.
    >>
    >>Thanks for all input,
    >>
    >>Paul.
    >>

    >
    >
    >
     
    Chiky, Jun 2, 2005
    #4
  5. Paul W

    Nick Gilbert Guest

    >If I use Cookieless=True it of course mangles the urls which means there
    >is no browser caching of the pages, so it is slow.


    The browser WILL still cache the pages. The session ID remains the same
    all the time as long as you don't force it to create a new session by
    linking to a page without including a session ID.

    The fact that the URL becomes:

    /(bktylw45s3f14345r3w4lx2j)/catalogue.aspx

    ...is no different to if it was:

    /catalogue/catalogue.aspx

    It's just a folder name and doesn't affect client side caching at all.

    If I were you, I'd use cookieless=true.

    Just ensure that your links in the website start with "~" rather than
    "/" or otherwise you'll create a new session. ~ gets resolved to the
    correct URL for the current session if you pass it through
    Server.ResolveUrl(). You don't need to call ResolveUrl manually for most
    internal functions that take URLs as arguments.

    eg Response.Redirect("~/basket.aspx");

    You might also have to convert some hard coded links (HTML) to
    asp:HyperLinks so you can use the "~" and thus avoid creating new sessions.

    Note that ~ doesn't work in <a> tags. It's a server side macro only.

    Hope this helps.

    Nick...
     
    Nick Gilbert, Jun 2, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Martin
    Replies:
    0
    Views:
    871
    James Martin
    Jul 22, 2003
  2. Grant

    how does cookieless = true work

    Grant, Aug 25, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    4,982
    Chris Jackson
    Aug 26, 2003
  3. R.A.
    Replies:
    3
    Views:
    610
    Patrice
    Apr 5, 2004
  4. MPF
    Replies:
    1
    Views:
    1,049
  5. _Who
    Replies:
    7
    Views:
    2,753
Loading...

Share This Page