All I want to do is be able to keep a users session while they are on my site.
At the moment I am trying to retreive the SessionID from within a base method by using jQuery.post() to call the base url:
public class HelloWorldTest : IRequiresSessionState { public static string Hello() { HttpContext hc = HttpContext.Current; if (hc.Session == null) { return "oops"; } return "Hello" + hc.Session.SessionID; } }
But the HttpContext.Current.Session is always null.
I can get the SessionID within XSLT but I need to be able to set a session variable after the page has loaded.
Imagin a user fills in a textbox on page one, and presses submit. I want to be able to save that input and display it to them on every page they navigate to within my site.
I would prefer not to have to use a usercontrol as in the future I will need to make this only be shown on certain pages and I know usercontrols cannot be called from XSLT.
I am working locally using UltiDev Cassini Web Server for ASP.NET 2.0 with umbraco 4.0.3
Any help at all would be fantastic I've been stuck on this for over a week now!
I dont know if this is the correct way of doing things but this has definatly helped me and I'm just trying to make it clearer for those that have a similar problem.
SessionID within base
Hi All,
All I want to do is be able to keep a users session while they are on my site.
At the moment I am trying to retreive the SessionID from within a base method by using jQuery.post() to call the base url:
But the HttpContext.Current.Session is always null.
I can get the SessionID within XSLT but I need to be able to set a session variable after the page has loaded.
Imagin a user fills in a textbox on page one, and presses submit. I want to be able to save that input and display it to them on every page they navigate to within my site.
I would prefer not to have to use a usercontrol as in the future I will need to make this only be shown on certain pages and I know usercontrols cannot be called from XSLT.
I am working locally using UltiDev Cassini Web Server for ASP.NET 2.0 with umbraco 4.0.3
Any help at all would be fantastic I've been stuck on this for over a week now!
Thanks
aghy
Actually using this forum helped me figure this one out. Actually it was this
httpcontextuser is null in base httpmodule
that helped the most.
Then all you have to do is got to the link mentioned by Morten Bock which is umbraco.codeplex
and copy the code you see there into a .cs file. Give it a different class name so instead of
call it
then compile it and put the .dll into your bin directory.
Then go to your web.config and change
to
I dont know if this is the correct way of doing things but this has definatly helped me and I'm just trying to make it clearer for those that have a similar problem.
aghy
is working on a reply...